<?php
namespace HC\Swoole;

use HC\Swoole\Socket\Request;

abstract class Socket
{
    /**
     * @var Request
     */
    public $request;

    /**
     * @param Request $request
     */
    public function __construct(Request $request)
    {
        $this->request = $request;
    }

    /**
     * @return \swoole_server
     */
    public function server()
    {
        return $this->request->server();
    }

    /**
     * @return array
     */
    public function args()
    {
        return $this->request->args();
    }

    abstract public function execute();
}
